package responder

import (
	"io"

	"github.com/bitwormhole/starter-security/security"
	"github.com/bitwormhole/starter/application"
)

type Request interface {
	application.SimpleContext
	Container() Container
	Session() security.Session

	Path() string
	URL() string
	Headers() map[string]string
	Parameters() map[string]string
	ContentType() string
	ContentEncoding() string
	ContentLength() int64

	ReadJSON(json interface{}) error
	ReadText() (string, error)
	ReadBinary() ([]byte, error)
	Read() (io.ReadCloser, error)

	Send(res Response)
	SendBinary(status int, data []byte)
	SendText(status int, text string)
	SendJSON(status int, json interface{})

	Error(err error)
}
